package ${basePackage}.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import ${basePackage}.entity.${upperStartModelName};
import ${basePackage}.mapper.${upperStartModelName}Mapper;
import ${basePackage}.request.body.PageCondition;
import ${basePackage}.service.I${upperStartModelName}Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.framework.boc.response.CommonResponse;
import org.springframework.stereotype.Service;

/**
 * <p>
 * ${tableComment} 服务实现类
 * </p>
 *
 * @author Leil
 * @since ${.now}
 */
@Service
public class ${upperStartModelName}ServiceImpl extends ServiceImpl<${upperStartModelName}Mapper, ${upperStartModelName}> implements I${upperStartModelName}Service {

    /**
     * 获取分页数据
     * @param condition     分页查询条件
     * @return              分页查询结果
     */
    public CommonResponse getPage(PageCondition<${upperStartModelName}> condition) {
        Page<${upperStartModelName}> pageCondition = new Page<>(condition.getCurrent(), condition.getSize());
        QueryWrapper<${upperStartModelName}> wrapper = new QueryWrapper<>(condition.getCondition());
        IPage<${upperStartModelName}> page = this.page(pageCondition, wrapper);
        return CommonResponse.success(page);
    }
}
